﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SigForm.aspx.cs" Inherits="SigForm" EnableSessionState="True" %>

<%@ Register assembly="Microsoft.Office.InfoPath.Server, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" namespace="Microsoft.Office.InfoPath.Server.Controls" tagprefix="cc1" %>

<%@ Register assembly="Microsoft.Office.InfoPath, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" Namespace="Microsoft.Office.InfoPath" TagPrefix="cc2" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">
    <title></title>
    
    <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js">

 </script>
 
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <cc1:XmlFormView ID="XmlFormView1" runat="server" height="100%" width="100%" 
            ShowFooter="False" ShowHeader="False" 
            EditingStatus="Editing" 
            oninit="InitForm" onnotifyhost="XmlFormView1_NotifyHost" />
    
    </div>
    <asp:Panel ID="Panel1" runat="server">
        <br />
        <asp:TextBox ID="TextBox1" name="TB1" runat="server" Height="1px" Width="1px"></asp:TextBox>
        <asp:Button ID="Button1" runat="server" 
    OnClientClick="javascript:GetSig();" onclick="Button1_Click" Text="Button" />
        <br />
        <br />
        <script src="SIGCAP/jSignature.min.js">
</script>
        <div id="signature" runat="server">
        </div>
        <script type="text/javascript">

    	    $(document).ready(function () {
    	        $("#signature").jSignature()
    	    })
	</script>
        <script type="text/javascript">

        function GetSig() {

        var $sigdiv = $("#signature")
        $sigdiv.jSignature()
	
	var datapair = $sigdiv.jSignature("getData")
	var tb = document.getElementById('<%=TextBox1.ClientID%>').value = datapair;
    


	
	
        }
    
    </script>
        &nbsp;</asp:Panel>
    <br />
    </form>
</body>
</html>
